﻿@using DistanceLearning.Models
@model DistanceLearning.Models.Teacher

@{
    AjaxOptions ajaxOpts = new AjaxOptions
                               {
                                   UpdateTargetId = "subjects_list",
                                   Url = Url.Action("TeacherSubjectsDetailsAndAdd", "Administration"),
                                   HttpMethod = "POST",
                               };
    Layout = null;
}
<h3 align="center">Преподаватель</h3>
<h4>@Model.UserDetails.FirstName @Model.UserDetails.PatronymicName @Model.UserDetails.LastName</h4>
<h5>Преподает дисциплины:</h5>

@using(Ajax.BeginForm(ajaxOpts))
{
    @Html.Hidden("teacherId", Model.TeacherID)
    <div id="subjects_list">
        @{
            Html.RenderPartial("_TeacherSubjects",  Model.TeacherSubjects.Select(ts => ts.Subject));
        }
        @*@Html.Action("TeacherSubjects", "Administration", Model.TeacherSubjects.Select(ts => ts.Subject))*@
    </div>
    <p>
        @Html.DropDownList("subjectName", new SelectList(ViewBag.Subjects, "SubjectName", "SubjectName"))
        <input type="submit" value="Добавить"/>
    </p>
}

